package com.gossip.model;

import java.io.IOException;
import java.net.URISyntaxException;

public class Css4TipDiv {

	// public static final int MAIN_WIDTH = 700;
	//
	// public static final int MAIN_HEIGHT = 767;

	// public static final String MAIN_WIDTH_STYLE = "width:" + MAIN_WIDTH +
	// "px;";
	//
	// public static final String MAIN_HEIGHT_STYLE = "height:" + MAIN_HEIGHT
	// + "px;";

	public static final String DEFAULT_DIV_BASIC_CSS = "position:absolute;border:solid 1px;display:block;"
			+ " line-height:17px;font-size:16px;";

	public static final String WHITE = "white";

	public static final String GRAY = "gray";

	public static final String YELLOW = "yellow";

	public static final String ORANGE = "orange";

	public static final String NONE = "none";

	public static final String WHITE_X = "#FFF";

	public static final String GRAY_X = "#CCC";

	public static final String YELLOW_X = "#FFE100";

	public static final String ORANGE_X = "#FF8000";

	public static final String COLOR_WITH_WHITE_BACKGROUND = "#00F";

	public static final String COLOR_WITH_GRAY_BACKGROUND = "#F00";

	public static final String COLOR_WITH_NONE_BACKGROUND = "green";

	public static final String WHITE_CSS = "background: " + WHITE_X + ";"
			+ " ;color:" + COLOR_WITH_WHITE_BACKGROUND + ";";

	public static final String GRAY_CSS = "background: " + GRAY_X + ";"
			+ " color:" + COLOR_WITH_GRAY_BACKGROUND + ";";

	public static final String YELLOW_CSS = "background: " + YELLOW_X + ";";

	public static final String ORANGE_CSS = "background: " + ORANGE_X + ";";

	public static final String NONE_CSS = "background: " + ORANGE_X + ";"
			+ " color:" + COLOR_WITH_NONE_BACKGROUND + ";";;

	// public static String getRamdonLeft() {
	// int left = Common.generateRamdon(0, MAIN_WIDTH);
	// return "left:" + left + "px;";
	// }
	//
	// public static String getRamdonTop() {
	// int top = Common.generateRamdon(0, MAIN_HEIGHT - 50);
	// return "top:" + top + "px;";
	// }

	public static String getStyle(String background) {
		String css = DEFAULT_DIV_BASIC_CSS;
		if ("random".equalsIgnoreCase(background)) {
			int r = Common.generateRamdon(0, 3);
			switch (r) {
			case 0:
				background = WHITE;
				break;
			case 1:
				background = GRAY;
				break;
			case 2:
				background = ORANGE;
				break;
			case 3:
				background = YELLOW;
				break;
			}
		}
		if (WHITE.equalsIgnoreCase(background)) {
			css += WHITE_CSS;
		} else if (GRAY.equalsIgnoreCase(background)) {
			css += GRAY_CSS;
		} else if (ORANGE.equalsIgnoreCase(background)) {
			css += ORANGE_CSS;
		} else if (YELLOW.equalsIgnoreCase(background)) {
			css += YELLOW_CSS;
		} else if (NONE.equalsIgnoreCase(background)) {
			css += NONE_CSS;
		}
		return css;
	}

	public static void main(String[] args) throws URISyntaxException,
			IOException {
		// for (int i = 0; i < 10; i++) {
		// System.out.println(getRamdonLeft() + "   " + getRamdonTop() + "  "
		// + getRamdonNumber());
		// }

	}

}
